//主要用来保护伪造的函威数让其更难被识破
;
(() => {
    "use strict";
    const $toString = Function.toString;
    const myFunction_toString_symbol = Symbol('( '.concat("", ')_', (Math.random() + "").toString(36)));
    const myToString = function () {
        return typeof this == 'function' && this[myFunction_toString_symbol] || $toString.call(this);
    };

    function set_native(func, key, value) {
        Object.defineProperty(func, key, {
            "enumerable": false,
            "configurable": true,
            "writable": true,
            "value": value
        })
    };
    delete Function.prototype['toString'];//删除原型链上的tostring
    set_native(Function.prototype, "toString", myToString);//自己定义个getter方法
    set_native(Function.prototype.toString, myFunction_toString_symbol, "function tostring(){ [native code] ]");//1套个娃保护一下我们定义的tostring
    this.catvm.safefunction = (func) => {
        set_native(func, myFunction_toString_symbol, `function ${myFunction_toString_symbol,func.name || ''}() { [native code] }`);//导出函数到globalThis
    };//导出函数到globalthis
}).call(this);